<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../js/flexible.js"></script>
    <script src="../js/echarts.min.js"></script>
    <style>
        .box {
            width: 7.5rem;
            height: 5rem;
        }
    </style>
</head>

<body>
    <!-- tooltip提示组件框，用于鼠标滑过或点击显示的框 -->
    <div class="box" id='box'></div>
    <script>
        const MyEcharts = echarts.init(document.getElementById('box'))
        const Xdata = [1, 2, 3, 4, 5, 6, 7, 8, 9]
        const Ydata = [10, 20, 30, 40, 50, 60, 70, 80, 90]
        const option = {
            toolbox: { //工具栏
                feature: {
                    saveAsImage: {}, //导出图片功能
                    dataView: {}, //数据视图，可以修改
                    restore: {}, //重置
                    dataZoom: {}, //区域缩放
                    magicType: { //动态图表类型切换
                        type: ['bar', 'line']
                    }
                }
            },
            xAxis: {
                type: 'category',
                data: Xdata
            },
            yAxis: {
                type: 'value',

            },
            series: [{
                data: Ydata,
                type: 'bar',
                name: '语文',
            }]
        };
        MyEcharts.setOption(option)
    </script>

</body>

</html>

</html>